package com.bruce.demo2.patterns.demo1.creational.demo01.singleton.demo03;

/**
 * @PROJECT_NAME design_patterns
 * @DESCRIPTION 测试类
 * @AUTHOR CNBruceLee
 * @DATE 2021/7/1 21:43
 */
public class Test {
    public static void main(String[] args) {

        Thread t1 = new Thread(new MyThread());
        Thread t2 = new Thread(new MyThread());

        t1.start();
        t2.start();

        /*
            多次运行发现有相同的结果，也有不相同的结果
            Thread-0:com.bruce.patterns.creational.singleton.demo3.Singleton@46775c78
            Thread-1:com.bruce.patterns.creational.singleton.demo3.Singleton@4aceeb5

            可以在Idea中启用线程模式进行调试测试，会发现问题
         */
    }
}
